package com.zj.core.activity

import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import com.fileutils.BaseConstant.BAIDU_TEMPLATE_ID
import com.quitutils.SwipeBackLayout
import com.systemutils.SystemUtil
import com.utils.DateUtils
import com.utils.DateUtils.*
import com.zj.core.base.TitleBarActivity
import com.zj.core.ui.AboutActivityUi
import com.zj.core.tools.Constant.Companion.getVersionMes
import org.jetbrains.anko.setContentView

class AboutActivity: TitleBarActivity(){
    lateinit var view: AboutActivityUi

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setQuitMode(SwipeBackLayout.EDGE_LEFT)
    }

    override fun onCreate(groupView: LinearLayout): View? {
        view= AboutActivityUi(groupView)
        return view.setContentView(this)
    }

    override fun initView(){
        setTitleText("关于")
        with(view){
            this.imei_tv.text=SystemUtil.getIMEI(this@AboutActivity)
            this.voice_template_tv.text= BAIDU_TEMPLATE_ID.toString()
            this.version_text_view.text = SystemUtil.getVersionName(this@AboutActivity)+"_"+SystemUtil.getVersionCode(this@AboutActivity)
            this.version_update_tv.text = DateUtils.getDateFormat(getVersionMes(this@AboutActivity).getProperty("VERSION_DATE").substring(0,12),DATE_FORMAT_15,DATE_FORMAT_6)
        }
    }
}